package com.wish233.wiliwilivideo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wish233.wiliwilivideo.domain.po.Comment;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author WHH
 * @description 针对表【comment(评论表)】的数据库操作Mapper
 * @createDate 2025-03-24 16:31:06
 * @Entity com.wish233.wiliwilivideo.domain.po.Comment
 */
public interface CommentMapper extends BaseMapper<Comment> {
    @Update("UPDATE comment SET likes = #{count} WHERE id = #{messageId}")
    void updateLikesById(@Param("messageId") Long messageId, @Param("count") Long count);

    List<Comment> getChildByPage(@Param("rootId") Long rootId
            , @Param("offset") int offset
            , @Param("pageSize") int pageSize);

}




